const axios = require('axios')
const isDev = process.env.NODE_ENV === 'development'

const send = (title, text) => {
  if (isDev) return
  return axios({
    url:
      'https://oapi.dingtalk.com/robot/send?access_token=35ddf96a1080602e2f8d44839b25b73606d4e3a73f76425e6384048516875f35',
    method: 'post',
    data: {
      msgtype: 'markdown',
      markdown: {
        title,
        text
      }
    }
  })
}

module.exports = send
